﻿using System;
using Colorful.Furniture.IEntity;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.ErpCustomerManagement
{
    /// <summary>
    /// 客户信息
    /// </summary>
    [Table(Name = "erp_customer")]
    public class Customer : AuditTenantSoftDeleteAggregateRoot
    {
        /// <summary>
        /// 客户编码
        /// </summary>
        [Column(Name = "id", IsPrimary = true)]
        public Guid Id { get; set; }
        
        /// <summary>
        /// 客户编号
        /// </summary>
        [Column(Name = "code")]
        public int? Code { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        [Column(Name = "name", StringLength = 50)]
        public string Name { get; set; }

        /// <summary>
        ///  类别
        /// </summary>
        [Column(Name = "type")]
        public Guid? Type { get; set; }

        /// <summary>
        /// 登录名
        /// </summary>
        [Column(Name = "login_name", StringLength = 50)]
        public string LoginName { get; set; }
        
        /// <summary>
        ///  备注
        /// </summary>
        [Column(Name = "remark", StringLength = 200)]
        public string Remark { get; set; }

        /// <summary>
        /// 状态（0：禁用；1：启用）
        /// </summary>
        [Column(Name = "status")]
        public int? Status { get; set; }

        /// <summary>
        /// 账户余额
        /// </summary>
        [Column(Name = "price", Scale = 4, Precision = 16)]
        public decimal? Price { get; set; }

        /// <summary>
        /// 已用授信额度
        /// </summary>
        [Column(Name = "credit_price", Scale = 4, Precision = 16)]
        public decimal? CreditPrice { get; set; }

        /// <summary>
        /// 冻结金额
        /// </summary>
        [Column(Name = "frozen_amount", Scale = 4, Precision = 16)]
        public decimal? FrozenAmount { get; set; }

        /// <summary>
        /// 初始授信额度
        /// </summary>
        [Column(Name = "credit_price_initial", Scale = 4, Precision = 16)]
        public decimal? CreditPriceInitial { get; set; }
        
        /// <summary>
        ///  商户密钥
        /// </summary>
        [Column(Name = "key", StringLength = 100)]
        public string Key { get; set; }

        /// <summary>
        ///  商户Secret
        /// </summary>
        [Column(Name = "secret", StringLength = 200)]
        public string Secret { get; set; }

        /// <summary>
        ///  排序字段：值越大越靠前
        /// </summary>
        [Column(Name = "sort")]
        public long Sort { get; set; }
        
    }
}
